package org.tech4j.captcha.api;

import org.tech4j.common.spi.SPI;

import java.util.concurrent.TimeUnit;

/**
 * @program: tech4j
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/4 11:30
 **/
@SPI
public interface CaptchaStore {

    /**
     * 存储验证码
     * @param key
     * @param value
     * @param timeout
     * @param timeUnit
     */
    void storeCaptcha(String key, String value, long timeout, TimeUnit timeUnit);

    /**
     * 删除验证码
     * @param key
     */
    void removeCaptcha(String key);

    /**
     * 读取验证码
     * @param key
     * @return
     */
    String readCaptcha(String key);
}
